package com.h3bpm.web.protalHanding;

import com.h3bpm.web.common.utils.SqlUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class OrcaleHelper {

    private static final Logger logger = LoggerFactory.getLogger(OrcaleHelper.class);


    public static void updateInstance(String intanceId, String OBJECTID) {
        logger.debug("更新数据状态Instace————————E_INSTANCE——————"+OBJECTID);
        try {
            if (intanceId != null && !"".equals(intanceId)&&OBJECTID!= null && !"".equals(OBJECTID)) {
                String sql2="UPDATE  E_INSTANCE  SET STATE='1' WHERE OBJECTID='"+ OBJECTID + "'";
                SqlUtil.doNoQuery(sql2);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void updateInstanceException(String intance) {
        logger.info("更新数据状态————————E_INSTANCE——————"+intance);
        try {
            if (intance!= null && !"".equals(intance)) {
                String sql2="UPDATE  E_INSTANCE  SET STATE='1' WHERE INSTANCE='"+ intance + "'";
                SqlUtil.doNoQuery(sql2);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    public static void updateInstanceUpdate(String objectId) {
        logger.debug("更新更新实例状态———————E_UPDATEINSTANCE——————"+objectId);
        try {
            if (objectId != null && !"".equals(objectId)) {
                String sql2="UPDATE  E_UPDATEINSTANCE  SET STATE='1' WHERE OBJECTID='"+ objectId + "'";
                SqlUtil.doNoQuery(sql2);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    public static void updateTask(String objectid) {
        logger.debug("更新代办状态————————objectid——————"+objectid);
        try {
            if (objectid != null && !"".equals(objectid)) {
                String sql2="UPDATE  E_TASK  SET STATE='1' WHERE objectid='"+ objectid + "'";
                SqlUtil.doNoQuery(sql2);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

    }


}
